# !/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: JHC000abc@gmail.com
@file: app_celery.py
@time: 2024/10/25 20:02 
@desc: 

"""
from celery import Celery


broker = 'redis://127.0.0.1:6379/1'
backend = 'redis://127.0.0.1:6379/2'

app_celery = Celery('tasks', broker=broker, backend=backend)

app_celery.conf.beat_schedule = {
    'clear-every-hour': {
        'task': 'tasks.clear',
        'schedule': 60 * 60.0,
    },
    'clear-five-minutes': {
        'task': 'tasks.check_result',
        'schedule': 5 * 60.0,
    },
    'check-token-redis-every-hour': {
        'task': 'tasks.check_token_redis',
        'schedule': 60 * 60.0,
    }
}
